\(\int \sqrt {a \sin ^2(x)} \, dx\) [3]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 10, antiderivative size = 14 \[ \int \sqrt {a \sin ^2(x)} \, dx=-\cot (x) \sqrt {a \sin ^2(x)} \]

[Out]

-cot(x)*(a*sin(x)^2)^(1/2)

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 14, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {3286, 2718} \[ \int \sqrt {a \sin ^2(x)} \, dx=-\cot (x) \sqrt {a \sin ^2(x)} \]

[In]

Int[Sqrt[a*Sin[x]^2],x]

[Out]

-(Cot[x]*Sqrt[a*Sin[x]^2])

Rule 2718

Int[sin[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Cos[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 3286

Int[(u_.)*((b_.)*sin[(e_.) + (f_.)*(x_)]^(n_))^(p_), x_Symbol] :> With[{ff = FreeFactors[Sin[e + f*x], x]}, Di
st[(b*ff^n)^IntPart[p]*((b*Sin[e + f*x]^n)^FracPart[p]/(Sin[e + f*x]/ff)^(n*FracPart[p])), Int[ActivateTrig[u]
*(Sin[e + f*x]/ff)^(n*p), x], x]] /; FreeQ[{b, e, f, n, p}, x] &&  !IntegerQ[p] && IntegerQ[n] && (EqQ[u, 1] |
| MatchQ[u, ((d_.)*(trig_)[e + f*x])^(m_.) /; FreeQ[{d, m}, x] && MemberQ[{sin, cos, tan, cot, sec, csc}, trig
]])

Rubi steps \begin{align*} \text {integral}& = \left (\csc (x) \sqrt {a \sin ^2(x)}\right ) \int \sin (x) \, dx \\ & = -\cot (x) \sqrt {a \sin ^2(x)} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 14, normalized size of antiderivative = 1.00 \[ \int \sqrt {a \sin ^2(x)} \, dx=-\cot (x) \sqrt {a \sin ^2(x)} \]

[In]

Integrate[Sqrt[a*Sin[x]^2],x]

[Out]

-(Cot[x]*Sqrt[a*Sin[x]^2])

Maple [A] (verified)

Time = 0.49 (sec) , antiderivative size = 16, normalized size of antiderivative = 1.14

method result size
default \(-\frac {a \cos \left (x \right ) \sin \left (x \right )}{\sqrt {a \left (\sin ^{2}\left (x \right )\right )}}\) \(16\)
risch \(-\frac {i \sqrt {-a \left ({\mathrm e}^{2 i x}-1\right )^{2} {\mathrm e}^{-2 i x}}\, {\mathrm e}^{2 i x}}{2 \left ({\mathrm e}^{2 i x}-1\right )}-\frac {i \sqrt {-a \left ({\mathrm e}^{2 i x}-1\right )^{2} {\mathrm e}^{-2 i x}}}{2 \left ({\mathrm e}^{2 i x}-1\right )}\) \(69\)

[In]

int((a*sin(x)^2)^(1/2),x,method=_RETURNVERBOSE)

[Out]

-1/(a*sin(x)^2)^(1/2)*a*cos(x)*sin(x)

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.36 \[ \int \sqrt {a \sin ^2(x)} \, dx=-\frac {\sqrt {-a \cos \left (x\right )^{2} + a} \cos \left (x\right )}{\sin \left (x\right )} \]

[In]

integrate((a*sin(x)^2)^(1/2),x, algorithm="fricas")

[Out]

-sqrt(-a*cos(x)^2 + a)*cos(x)/sin(x)

Sympy [A] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.21 \[ \int \sqrt {a \sin ^2(x)} \, dx=- \frac {\sqrt {a \sin ^{2}{\left (x \right )}} \cos {\left (x \right )}}{\sin {\left (x \right )}} \]

[In]

integrate((a*sin(x)**2)**(1/2),x)

[Out]

-sqrt(a*sin(x)**2)*cos(x)/sin(x)

Maxima [A] (verification not implemented)

none

Time = 0.40 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.93 \[ \int \sqrt {a \sin ^2(x)} \, dx=-\frac {\sqrt {a}}{\sqrt {\tan \left (x\right )^{2} + 1}} \]

[In]

integrate((a*sin(x)^2)^(1/2),x, algorithm="maxima")

[Out]

-sqrt(a)/sqrt(tan(x)^2 + 1)

Giac [A] (verification not implemented)

none

Time = 0.34 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.21 \[ \int \sqrt {a \sin ^2(x)} \, dx=-{\left (\cos \left (x\right ) \mathrm {sgn}\left (\sin \left (x\right )\right ) - \mathrm {sgn}\left (\sin \left (x\right )\right )\right )} \sqrt {a} \]

[In]

integrate((a*sin(x)^2)^(1/2),x, algorithm="giac")

[Out]

-(cos(x)*sgn(sin(x)) - sgn(sin(x)))*sqrt(a)

Mupad [B] (verification not implemented)

Time = 13.75 (sec) , antiderivative size = 40, normalized size of antiderivative = 2.86 \[ \int \sqrt {a \sin ^2(x)} \, dx=-\frac {\sqrt {2}\,\sqrt {a}\,\sqrt {2\,{\sin \left (x\right )}^2}\,\left (-{\sin \left (x\right )}^2+\frac {\sin \left (2\,x\right )\,1{}\mathrm {i}}{2}+1\right )}{{\sin \left (x\right )}^2\,2{}\mathrm {i}+\sin \left (2\,x\right )} \]

[In]

int((a*sin(x)^2)^(1/2),x)

[Out]

-(2^(1/2)*a^(1/2)*(2*sin(x)^2)^(1/2)*((sin(2*x)*1i)/2 - sin(x)^2 + 1))/(sin(2*x) + sin(x)^2*2i)